<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渠道活动商品管理</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../../res/plugins/chosen/css/chosen.css" rel="stylesheet">
    <link href="../../res/plugins/channel/css/yfChannel.css" rel="stylesheet">
    <script src="../../res/js/comm.js"></script>
    <script src="../../res/plugins/validate/jquery.validate.min.js"></script>
    <script src="../../res/plugins/validate/messages_zh.min.js"></script>
    <script src="../../res/plugins/ajaxsubmit/ajaxsubmit-0.1.4.js"></script>
    <script src="../../res/plugins/chosen/js/chosen.jquery.js"></script>
    <script src="../../res/plugins/channel/yfChannel.js"></script>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="panel panel-info">
        <div class="panel-heading"><i class="fa fa-info-circle"></i> 活动商品列表</div>
        <div class="panel-body">
            <div class="ibox-query">
                <form id="queryForm" method="post" class="form-horizontal">
                    <input name="orderStatus" type="hidden">
                    <div class="form-group">

                        <label class="col-sm-1 control-label">渠&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;道</label>

						<div class="col-md-2">
							<input placeholder="渠道" id="channelCode" name="channelCode1" class="form-control" type="text">
						</div>
						<input type="hidden" name="channelCodes" id="channelCodes">
                        <label class="col-sm-1 control-label">商品编码</label>
                        <div class="col-sm-2"><input name="goodsCode" class="form-control" type="text"></div>

                        <label class="col-sm-1 control-label">商品名称</label>
                        <div class="col-sm-2"><input name="channelGoodsName" class="form-control" type="text"></div>

                       

                        <label class="col-sm-1 control-label" >状态</label>
                        <div class="col-sm-1">
                            <select name="channelGoodsStatus" class="form-control">
                              <option value="">全部</option>
                              <option value="ON_LINE">上架</option>
                              <option value="OFF_LINE">下架</option>
                            </select>
                        </div>
                        <!-- <div>
	                       <button style="margin-left: 30px;" class="btn btn-info" onclick='search()'
	                               type="button"><i class="glyphicon glyphicon-search"></i> 查询
	                       </button>
	                       <button style="margin-left: 10px;" class="btn btn-info" onclick="resetForm()" type="button"><i class="glyphicon glyphicon-share-alt"></i> 重置  </button>
	                   </div> -->
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">活动开始时间</label>
                        <div class="col-sm-2"><input class="layui-input" id='activityBeginTime' name="activityBeginTime"  placeholder="活动开始时间" type="text" readonly onclick="layui.laydate({elem: this,  format: 'YYYY-MM-DD 00:00:00'})"> </div>
                        
                        <label class="col-sm-1 control-label">活动结束时间</label>
                        <div class="col-sm-2"><input class="layui-input" id='activityEndTime' name="activityEndTime"   placeholder="活动结束时间" type="text" readonly   onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD 23:59:59'})"> </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-10 col-sm-2">
                            <button class="btn btn-info" onclick='search()' type="button"><i class="glyphicon glyphicon-search"></i> 查询</button>
                            &nbsp;
                            <button class="btn btn-info" onclick="resetForm()" type="button"><i class="glyphicon glyphicon-share-alt"></i> 重置  </button>
                        </div>
                    </div>
                </form>
            </div>

            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="bars pull-left">
                        <p>
                            <button type="button" name="orderStatus" value="SHIPMENT_WAITING"  class="btn btn-sm btn-warning" onclick="showImportExcel()"><i></i> 批量导入</button>
                        </p>
                      
                    </div>
                    
                    <table id="table" data-show-export="true">
                        <thead>
                        <tr>
                            <th data-checkbox="true" ></th>
                            <th data-field="id" data-visible="false"></th>
                            <th data-align="center" data-formatter="showControllFormat">操作</th>
                            <th data-align="center" data-field="goodsCode">商品编码</th>
                            <th data-align="center" data-field="goodsName">商品名称</th>
                            <th data-align="center" data-field="channelCode">渠道编码</th>
                            <th data-align="center" data-field="categoryNames">商品类目名称</th>
                            <th data-align="center" data-field="channelGoodsName">渠道商品名称</th>
                            <th data-align="center" data-field="guidePrice">指导价</th>
                            <th data-align="center" data-field="channelPrice">渠道价</th>
                            <th data-align="center" data-field="activityPrice">活动价</th>
                            <th data-align="center" data-formatter="activityTimeFormat" data-field="activityTime">活动时间</th>
                            <th data-align="center" data-field="stock">可销售库存</th>
                            <th data-align="center" data-formatter="showFormatStatus" data-field="status">状态</th>
                            <th data-align="center" data-field="categoryCode" data-visible="false">类目编码</th>
                            <th data-align="center" data-field="recommendIndex" data-visible="false">推荐指数</th>
                            <th data-align="center" data-field="goodsMark" data-visible="false">商品角标</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="import-form" class="modal fade" aria-hidden="true" style="display: none;">
    <div class="modal-dialog" style="width: 500px;">
        <div class="modal-content animated bounceInTop">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                    aria-hidden="true">&times;</button>
                <h4 class="modal-title">活动价商品导入</h4>
            </div>
            <div class="modal-body" style="padding-top: 0px;">
                <form class="form-horizontal" name="uploadForm" id="uploadForm" enctype="multipart/form-data" method="post">
                    <div style="width: 450px; height: 260px;padding: 5px 30px;">
            <div class="row" style="text-align: left;">
                <div class="col-sm-6">
                    <a href="https://img.yifengx.com/zt/templet/商品活动价导入模板-ecp.xlsx" style="text-decoration: underline;"><span style="color: blue;">模板下载</span></a>
                </div>
            </div>
                    <div class="row" style="padding-top: 15px;">
                        <div class="col-md-3" style="width: auto">
                            <label class="control-label">渠&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;道</label>
                        </div>
                        <div class="col-md-6">
                            <input placeholder="渠道" id="channelCodeImport" name="channelCode2" class="form-control" type="text">
                        </div>
                    </div>
                    <input type="hidden" name="channelCodes" id="channelCodesImport">
            
                    <div class="row" style="padding-top: 15px;">
                        <label class="col-sm-3" style="padding-top: 8px;">请选择</label>
                        <div class="col-sm-6">
                            <input style="width: 230px; padding-top: 5px;" name="excelFile" type="file" id="excelFileInput"/>
                        </div>
                    </div>
                
                    <div class="row" style="padding-top: 15px;">
                        <div class="col-sm-3">&nbsp;</div>
                        <div class="col-sm-6">
                            <button class="btn btn-info" type="button" onclick="importExcel()" id="importExcelButton">上传</button>
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-sm-2">&nbsp;</div>
                        <div class="col-sm-10" id="prompt" style="color:red" hidden></div>
                    </div>
                
                    <div class="row" style="padding-top: 30px;">
                        <div class="col-sm-2">&nbsp;</div>
                        <div class="col-sm-10">
                            <textarea id="uploadImgResult" rows="4" style="width:80%"></textarea>
                        </div>
                    </div>

                </div>
                </form>
                </div>
            <div class="modal-footer"
                style="margin: 0 auto; text-align: center;">
                <button class="btn btn-sm btn-info" type="button" onclick="importAll()" id="importAll" hidden>全部导入</button>
                <button class="btn btn-sm btn-default" id="cancerModel" type="button"
                    data-dismiss="modal">
                    <strong>取消</strong>
                </button>
                <button class="btn btn-sm btn-default" type="button" onclick="goBack()" id="goBack" hidden>返回</button>
            </div>
        </div>
    </div>
</div>
</body>

<script type="text/html" id="editFormTemplate">
    
    <form id="editForm" class="form-horizontal" name="editForm">
        <input type="hidden" name="id" value="{{d.id}}" />
        <input type="hidden" name="channelCode" value="{{d.channelCode}}" />
        <input type="hidden" name="goodsCode" value="{{d.goodsCode}}" />
       <div class="col-md-12" style="margin-top: 50px;height:400px;width:700px;text-align:center">
       <div class="form-group" style="padding-left:140px;">
        <label class="col-sm-2 control-label" style="width:150px;">商品编码</label>
           <div class="col-sm-5" style="margin-left:20px;"><input class="form-control" type="text" value="{{d.goodsCode ? d.goodsCode : ''}}" readonly="readonly"></div>
       </div>
       <div class="form-group" style="padding-left:140px;">
            <label class="col-sm-2 control-label" style="width:150px;">商品名称</label>
            <div class="col-sm-5" style="margin-left:20px;"><input class="form-control" type="text" value="{{d.goodsName ? d.goodsName : ''}}" readonly="readonly"></div>
        </div>
       <div class="form-group" style="padding-left:140px;">
           <label class="col-sm-2 control-label" style="width:150px;">活动开始时间</label>
           <div class="col-sm-5" style="margin-left:20px;"><input class="layui-input" id='activityBeginTime2' name="activityBeginTime" value="{{d.activityBeginTime  ? d.activityBeginTime : ''}}"   placeholder="活动开始时间" type="text" readonly   onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD 00:00:00'})"> </div>
       </div>
       <div class="form-group" style="padding-left:140px;">
            <label class="col-sm-2 control-label" style="width:150px;">活动结束时间</label>
            <div class="col-sm-5" style="margin-left:20px;"><input class="layui-input" id='activityEndTime2' name="activityEndTime" value="{{d.activityEndTime  ? d.activityEndTime : ''}}"   placeholder="活动结束时间" type="text" readonly   onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD 23:59:59'})"> </div>
            <!-- <div class="col-sm-4" style="margin-left:20px;"><input name="activityEndTime" class="form-control" type="text" value="{{d.activityEndTime ? d.activityEndTime : ''}}"></div> -->   
        </div>
        <div class="form-group" style="padding-left:140px;">
           <label class="col-sm-2 control-label" style="width:150px;">活动价</label>
           <div class="col-sm-5" style="margin-left:20px;"><input name="activityPrice" class="form-control" type="text" value="{{d.activityPrice ? d.activityPrice : ''}}"></div>
       </div>
       <div class="form-group" style="padding-left:140px;">
            <div class="col-sm-10" id="updateResult"></div>
        </div>
       
     </div>
    </form>
    </script>

<script src="../../js/goods/activityGoods.js"></script>
<script type="text/javascript" src="../../res/plugins/yifeng/channel.js"></script>